<template>
  <div>
    <div class="header">
      <router-link to="/list" class="header-title">刘小锋的电商网站示例</router-link>
      <div class="header-menu">
        <router-link to="/cart" class="header-menu-cart">
          购物车
          <span class="test-cartnumber" v-if="cartList.length">{{ cartList.length }}</span>
        </router-link>
      </div>
    </div>
    <router-view></router-view>
  </div>
</template>
<script setup>
import { computed } from "vue";
import { cartStore } from "./store/cart";

const store = cartStore();

const cartList = store.cartList;
</script>